# 控制器
snippet _bfa    在路由执行前执行
	before_action :${0}
snippet _afa    在路由执行后执行
	after_action :${0}
snippet _ara    环绕路由执行
	around_action :${0}
snippet _rsf    自定义异常出错页面
	rescue_from ${1}, with: :${0}
snippet _rst    响应请求
	respond_to ${0}
snippet _rdt    转向
	redirect_to ${0}
snippet _pa     参数数组
	params[:${0}]
snippet _par    安全获取参数
	params.require(:${1}).permit(${0})
snippet _la     指定布局
	layout '${0}'
snippet _re     渲染模版
	render ${0}
# 模型
snippet _ho     一对一
	has_one :${0}
snippet _hm     一对多
	has_many :${0}
snippet _bt     多对一
	belongs_to :${0}
snippet _va     数据验证
	validates :${0}
snippet _vap    非空验证
	validates_presence_of :${0}
snippet _val    长度验证
	validates_length_of :${0}
snippet _van    数字验证
	validates_numericality_of :${0}
snippet _vau    唯一验证
	validates_uniqueness_of :${0}
snippet _vaf    格式验证
	validates_format_of :${0}
snippet _vai    确保是某些值
	validates_inclusion_of :${0}
snippet _vae    确保不是某些值
	validates_exclusion_of :${0}
snippet _aln    是否允许为nil
	allow_nil: ${0}
snippet _alb    是否允许为空
	allow_blank: ${0}
snippet _msg    设定验证失败时的错误信息
	message: ${0}
snippet _pre    必须有值
	presence: true${0}
snippet _uni    必须唯一
	uniqueness: true${0}
snippet _fk     指定外键
	foreign_key: :${0}
snippet _bfs    在保存前执行
	before_save :${0}
snippet _afs    在保存后执行
	after_save :${0}
# 测试
snippet _as     断言
	assert ${0}
snippet _ase    相等性测试
	assert_equal ${0}
snippet _asr    响应测试
	assert_response ${0}
snippet _ass    包含测试
	assert_select ${0}
snippet _asd    差异测试
	assert_difference ${0}
# 配置
snippet _res    资源路由
	resources :${0}
snippet _mem    归属于单个资源的路由
	member do
	  ${0}
	end
snippet _col    归属于一组资源的路由
	collection do
	  ${0}
	end
snippet _sc     存放在某个子文件夹下的路由，但该子文件夹的名字不出现在URL里面
	scope module: '${1}' do
	  ${0}
	end
snippet _ns     命名空间（和scope类似，但命名空间的名字会出现在URL里面）
	namespace :${1} do
	  ${0}
	end
# 常量
snippet _dev    开发环境
	development${0}
snippet _t      测试环境
	test${0}
snippet _prod   生产环境
	production${0}
# 判断运行环境
snippet _ifd    is development mode ?
	Rails.env.development?${0}
snippet _ift    is test mode ?
	Rails.env.test?${0}
snippet _ifp    is production mode ?
	Rails.env.production?${0}
# 常用辅助方法
snippet _sk     将一个Hash的键名全部转成Symbol
	symbolize_keys${0}
snippet _pk     从数据库取数据时，只取某些字段，并将这些字段值汇集成一个数组
	pluck(:${0})
snippet _db     添加调试断点
	debugger${0}
snippet _auth   验证密码
	authenticate${0}
# 常用变量
snippet ses     SESSION
	session${0}
snippet coo     COOKIE
	cookies${0}
# 常用方法
snippet _fi     index
	def index
	  ${0}
	end
snippet _fs     show
	def show
	  ${0}
	end
snippet _fn     new
	def new
	  ${0}
	end
snippet _fe     edit
	def edit
	  ${0}
	end
snippet _fc     create
	def create
	  ${0}
	end
snippet _fu     update
	def update
	  ${0}
	end
snippet _fd     destroy
	def destroy
	  ${0}
	end
# 常用代码片段
snippet _crud   CRUD方法组
	def index
	  ${0}
	end
	
	def show
	end
	
	def new
	end
	
	def edit
	end
	
	def create
	end
	
	def update
	end
	
	def destroy
	end
